VERSION=`git describe --tags`
FILENAME=rcvr-json-mqtt

build:
	go build -buildmode=plugin -o ./demo-rcvr.so ./receiver.go
	#go build -buildmode=plugin -o ./${FILENAME}-${VERSION}-amd64-darwin.so ./receiver.go

build_arm:
	env CC=$$HOME/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -trimpath -buildmode=plugin -ldflags "-s -w" -o ./${FILENAME}-${VERSION}-arm64-linux.so ./receiver.go

build_amd64:
	# build in linux
	env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags="-w -s" -buildmode=plugin -o ./${FILENAME}-${VERSION}-amd64-linux.so ./receiver.go

.PHONY: build
